package com.shanzmoo.base.util;

import static cn.hutool.core.bean.BeanUtil.copyProperties;
import static cn.hutool.core.util.ReflectUtil.newInstance;

public class ObjectUtils {

    /**
     * 对象转换
     * @param source
     * @param targetClass
     * @param <T>
     * @return
     */
    public static <T> T convert(Object source,Class<T> targetClass){
        T target = newInstance(targetClass);
        copyProperties(source,target);
        return target;
    }

}
